package com.zoweunion.mechanic.model.things;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Map;

/**
 * 设备数据封装类
 */
@Data
@Accessors(chain = true)
public class ThingsData {

    private static final String TABLE_PREFIX = "pc_car_data_fast";

    /**
     * 车号
     */
    private String cId;
    /**
     * 物联网号
     */
    private String thingsId;

    /**
     * 智能对象模版id
     */
    private String intelligentTemplateId;

    /**
     * 表名
     */
    private String tableName;

    /**
     * 获取车辆设备信息
     */
    private Map<String, Object> pcCarData;

    /**
     * 智能模版字段数组
     */
    private List<Map<String, Object>> intelligentTemplateDetails;

    /**
     * 故障模版字段数组
     */
    private List<Map<String, Object>> faultCodeTemplateDetails;


    public String getTableName() {
        return TABLE_PREFIX + getIntelligentTemplateId();
    }

    public static String getTableName(String intelligentTemplateId) {
        return TABLE_PREFIX + intelligentTemplateId;
    }
}
